﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PowerHub.MES.Entities.Log
{
    /// <summary>
    /// 请求操作日志
    /// </summary>
    [Table("Log_Request")]
    public class Log_Request:BaseEntity
    {
        /// <summary>
        ///  IP 地址
        /// </summary>
        public string? IPAddress { get; set; }
        /// <summary>
        /// 地理位置信息
        /// </summary>
        public string? LocationInfo { get; set; }
        /// <summary>
        /// 请求的 URL
        /// </summary>
        public string? RequestUrl { get; set; }
        /// <summary>
        /// 功能名称
        /// </summary>
        public string? FunctionName { get; set; }
        /// <summary>
        /// 操作系统/设备信息
        /// </summary>
        public string? DeviceInfo { get; set; }
        /// <summary>
        /// 请求的返回状态码
        /// </summary>
        public int? ResponseStatus { get; set; }

        public Log_Request(string? iPAddress, string? locationInfo, string? requestUrl, string? functionName, string? deviceInfo, int? responseStatus)
        {
            Id = Guid.NewGuid().ToString();
            IPAddress = iPAddress;
            LocationInfo = locationInfo;
            RequestUrl = requestUrl;
            FunctionName = functionName;
            DeviceInfo = deviceInfo;
            ResponseStatus = responseStatus;
        }
    }
}
